Welcome to the airquality package. This package uses various data from the .
It includes various functions that help you to get an overview about the airquality in any town. You can:
In the following, each function is explained in detail and examples are provided.
#github_install can only be added when the week 3 branch is merged
#install_github('Programming-The-Next-Step-2022/airquality')
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_aq_df("Amsterdam", "NL")
## Component Index / Concentration
## 1 AQI 2.00
## 2 CO 200.27
## 3 NO 0.33
## 4 NO2 7.54
## 5 O3 92.98
## 6 SO2 2.35
## 7 PM2_5 7.39
## 8 PM_10 14.62
## 9 NH3 0.60
To display the output to users in a nicer way, you can use the gt::gt() function
gt(current_aq_df())
| Component | Index / Concentration |
|---|---|
| AQI | 2.00 |
| CO | 200.27 |
| NO | 0.33 |
| NO2 | 7.54 |
| O3 | 92.98 |
| SO2 | 2.35 |
| PM2_5 | 7.39 |
| PM_10 | 14.62 |
| NH3 | 0.60 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a plot showing the average AQI per day over the last two weeks.
plot_aqi_hist("Paris", "FRA")
This function takes the city, the country (use ISO 3166 country codes), and the desired subcomponent (e.g., co) as arguments. It outputs a plot showing the average concentration of for example carbon monoxide over the last two weeks.
plot_comp_hist("Rome", "ITA")
This function shows the current AQI in the ten largest European cities. The values are colored according the AQI.
current_aq_table()
| Current Airquality Index (AQI) of Top 10 Major Europan Cities | |
|---|---|
| Cities | AQI |
| Istanbul | 5 |
| London | 1 |
| Berlin | 1 |
| Madrid | 2 |
| Kyiv | 2 |
| Rome | 3 |
| Bucharest | 2 |
| Paris | 2 |
| Vienna | 2 |
| Hamburg | 1 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_weather("Berlin", "GER")
| Component | Data |
|---|---|
| Current Weather | clear sky |
| Current Temperature | 19.33 |
| Feels Like Temperature | 18.78 |
| Min Temperature | 17.83 |
| Max Temperature | 20.55 |
| Air Pressure | 1007 |
| Humidity | 56 |
| Visibility | 10000 |
| Wind Speed | 5.36 |
| Wind Direction | 280 |
| Sunrise | 1653533753 |
| Sunset | 1653592283 |